package com.lucanjun.cn.springsecurity.common.exception;

import com.lucanjun.cn.springsecurity.common.result.HttpResultCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author lucanjun
 * @create 2025-03-10
 * @describe 自定义异常
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BusinessException extends RuntimeException {

    private Integer code;
    private String message;

    public BusinessException(HttpResultCodeEnum resultCodeEnum) {
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }

}
